home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / Q-R / RR⁄Tabby Source Code.cpt / Import 2.55.source < prev    next >
Text File  |  1990-05-25  |  57KB  |  1,923 lines

  1.  
  2.      ' Code by:      Mike Lininger
  3.      '               385 Bowling Green Place 
  4.      '               Gahanna, Ohio  43230
  5.      '               (614) 471-6209 (BBS)
  6.  
  7. 5-25-90
  8.  
  9. I am making most of my code available to anyone interested in developing 
  10. their own Second Sight/Tabby utilities.  This source is not designed to be 
  11. compiled and run.  It is missing key functions and pieces of code that are 
  12. Copyright me and others, that are not to be released at this time. 
  13.  
  14. This code is for example purposes only.  It illustrates various ways of reading
  15. writing and process data from a variety of SS/Tabby files.  It illustrates
  16. the use of Block Reads and Indexes amoung other things.
  17.  
  18. If you use any portion of this code you must abide by two rules, or you
  19. void the agreement that I am making with you and are subject what the law
  20. dictates.
  21.  
  22. They are simple. 
  23.  
  24. 1.  If you us any of this code you must give Michael Lininger and Lininger 
  25. Technology credit in both the program and the documentation.
  26.  
  27. 2.  It is agreed I am to receive a free copy of the program whether it is 
  28. free, sharware or commercial.
  29.  
  30. Now you must read on a little further and we will be done.
  31.  
  32. A little history on why I choose ZBasic as the root for my utilities.
  33. I use to be one of those people that would smirk every time someone mentioned
  34. they were using BASIC (until 3 years ago I and others had ever right to
  35. smirk) and would say how nice.  But thought yeh!  Real programmers only use
  36. C or Assembler.
  37.  
  38. Then came along Microsofts QuickBasic for the IBM.  This baby was hot 
  39. it gave you all features of C and Pascal, plus core logic of Assembler, 
  40. all packaged into a neat super easy to learn and use package.  This cut out
  41. months of development work plus the finial applications were a hell of a lot 
  42. better looking, cause you could do so much in a short period of time.  
  43. This set the tide for a new generation of Basic's.  Zedcor introduced ZBasic 
  44. for the mac, which gave complete control over the toolbox plus it compiled 
  45. into nice neat assembly and was fast. 
  46.  
  47. ZBasic I have found to be extremely powerful and fast, in most cases it 
  48. matches or out performs the best C compilers out there. Now when someone 
  49. says heh I finished this great C project that I have been working on for 6 
  50. months, I now smirk and say how nice.  But think yeh!  I could have done 
  51. the same thing in 1/4 the time and saved you 300,000.00 and ended up with 
  52. a lot cleaner and more professional looking product all at the cost of an 
  53. extra 14k of file size.
  54.  
  55. The only draw back to ZBasic is it lack of Data structures, but this is
  56. made up for the use of Indexes.  C programmer salivate all over the place
  57. at the mention of theses babies.  They give you performance you never dreamed
  58. of.  Now of we could just get Zedcor to give us a dozen more, WOW.
  59.  
  60. Moral of the story - DO NOT EVER underestimate the POWER of Compiled Basic.
  61.  
  62. Have at it.  I hope a lot of people will use this as a jumping off point
  63. and dive into creating a flood of new SS/Tabby utilities.
  64.  
  65. I can be reached on the networks if you have questions.
  66.  
  67.         614-471-6209 9600 baud
  68.         614-471-5733 2400 baud
  69.  
  70.         M.Lininger  Genie
  71.         Mike Lininger FidoNet (Tabby, RRH, MANSION echoes)
  72.         Mike Lininger 1:226/200
  73.         Mike Lininger via cmhGate - Net 226 fido<=>uucp gateway Col, OH
  74.         UUCP: ...!ous-cis!n8emr!cmhgate!200.2!Mike.Lininger
  75.         INET: Mike.Lininger@p2.f200.n226.z1.FIDONET.ORG
  76.  
  77.  
  78.  
  79.     ' This baby is a little old and reflects, see export for block reads
  80.  
  81.     ' Code is in ZBasic 5.0
  82.     ' Settings 8,2,4,5,50,mklt,TEXT,LONG,Space Req. after Keywords
  83.     '
  84.     ' Start date: 03-01-89
  85.     ' Last modify date: 02-24-90
  86.     ' Version: 2.55 includes AreaFix
  87.     ' Import Module for Tabby 2.0
  88.     ' MKLi - Creator
  89.     ' TImp - Type
  90.  
  91.  
  92.      ' To Prevent your application from say "You will not be able to print"
  93.      ' if it does not find a Print Driver in your system do the following
  94.      ' on the finial campiled application.  DO NOT DO IT ON ZBASIC ITSELF.
  95.      ' Use FEDIT do a Hex search for 50EDFD3C and change 50ED to FD3C.
  96.  
  97.      ' Sets up application.  Turns off Startup Window, Sets Default Mouse
  98.      WINDOW OFF
  99.      COORDINATE WINDOW
  100.      FLUSHEVENTS
  101.  
  102.      DIM T%,L%,B%,R%,MY%,MX%:    ' Must be dimensioned for toolbox calls
  103.  
  104.      DIM 1 Bit$(10):             ' Storage area for Message Status Byte
  105.      DIM 1 MessageSection$(255): ' Storage area 1 byte for 255 message sections
  106.      DIM 1 UserFlag$(2000):      ' MessageFlag bit - to alert user he has mail waiting
  107.      DIM 32 User$(2000):         ' Holds user First and Last Name or comparision
  108.      DIM 80 Tabby$(100):         ' Lanuch Sequence for rest of tabby chain
  109.      DIM 26 MsgName$(255):       ' Holds Section Names
  110.      DIM MsgCount%(255):         ' Holds import count for that section
  111.      Field%=1:ERROR=0:Cur%=128:AreaFixFlag%=0
  112.    
  113.  
  114.      ' Upper/Lower Case Function
  115.  
  116.      LONG FN LCASE$(Sting$)
  117.           FOR x%=2 TO LEN(Sting$)
  118.                a%=PEEK(VARPTR(Sting$)+x%)
  119.                IF (a%>64) AND (a%<91) AND k%=0 THEN a%=a%+32
  120.                IF a%=32 THEN k%=1 ELSE k%=0
  121.                POKE VARPTR(Sting$)+x%,a%
  122.           NEXT x%
  123.      END FN=Sting$
  124.  
  125.  
  126.     ' convert string resource to a string, handle must be passed to this function
  127.   
  128.      LONG FN ReturnString$(SHndl&)
  129.      
  130.              FByte%=PEEK(PEEK LONG(SHndl&))
  131.              String$=""
  132.       
  133.              FOR I%=1 TO FByte%
  134.                     String$=String$+CHR$(PEEK(PEEK LONG(SHndl&)+I%))
  135.              NEXT I%
  136.      
  137.      END FN = String$
  138.  
  139.  
  140.      ' This function turns a Pascal-encoded string into ZBasic-usable form
  141.  
  142.      DEF FN MakeString$(String$) = MID$(String$, 2, ASC(LEFT$(String$,1)))
  143.  
  144.  
  145.  
  146.      WND=1:GOSUB "Build_Main_Window"
  147.      GOSUB "Cursor_Spin"
  148.  
  149.      ' Loads starting values and pathnames from Str Resource file
  150.  
  151.      GOSUB "Get_Resource_Values"
  152.      HighMessage&=OldHighMessage&
  153.      GOSUB "Cursor_Spin"
  154.  
  155.  
  156.      ' Checks to see if mouse key is down, if so then goto configure menu
  157.   
  158.      MOUSE ON
  159.      DEF MOUSE = 0
  160.      Hold%=MOUSE(3)
  161.      LONG IF Hold% <> 0
  162.  
  163.          GOSUB "Cursor_Spin"
  164.          DEF MOUSE = -1
  165.          WINDOW CLOSE #1
  166.          GOSUB "Configure Menu"
  167.          IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  168.          CURSOR 0
  169.          END
  170.  
  171.      END IF
  172.      MOUSE OFF
  173.      DEF MOUSE = -1
  174.  
  175.      GOSUB "Cursor_Spin"
  176.      IF LEN(BBSFolder$) <=1 THEN BBSFolder$=""
  177.      GenericFile$=BBSFolder$+"Generic"
  178.      MessagesFile$=BBSFolder$+"Messages"
  179.      ConfigFile$=BBSFolder$+"Config"
  180.      Userlog$=BBSFolder$+"UserLog"
  181.      IF RRHost$="" THEN RRHost$="Red Ryder Host"
  182.      RRHost$=BBSFolder$+RRHost$
  183.      TabbyNet$=BBSFolder$+"TabbyNet"
  184.      NextLaunch$=BBSFolder$+"Launch.Next"
  185.      AreaFix$=BBSFolder$+AreaFix$
  186.      AreaFixFile$=BBS$+"AreaFix.req"
  187.  
  188.      ' Checks for valid file names and paths
  189.  
  190.      GOSUB "Get_File_Info"
  191.  
  192.      StartTime$=TIME$+" "+DATE$+" Import Start"
  193.      PerMinuteStart&=TIMER: ' Staring time for calculation of Msgs processed per minute
  194.      StartTime&=TIMER
  195.  
  196.    ' Initialize local variables
  197.  
  198.      ImportCount&=0
  199.      EchoCount&=0
  200.      NetCount&=0
  201.      BarOffSet%=19
  202.      BatchCount&=0
  203.      MsgCount&=0
  204.      DeleteCount&=0
  205.      BytesToProcess&=MsgTxtBytes&-(MessageOffSet&+MessageLength&): 'Bytes already processed
  206.      GOSUB "Cursor_Spin"
  207.  
  208.      ScreenLine$="* Importing Messages *"
  209.      GOSUB "Screen_Log_Display"
  210.     
  211.      ' Initialize values on Process Control Screen
  212.  
  213.      TEXT 4,12,,
  214.      CALL MOVETO(225,35):PRINT USING "###,###";HighMessage&
  215.      CALL MOVETO(225,51):PRINT USING "###,###";LowMessage&
  216.      CALL MOVETO(225,67):PRINT USING "###,###";OldHighMessage&
  217.      CALL MOVETO(225,99):PRINT USING "###,###";ImportCount&
  218.      CALL MOVETO(225,115):PRINT USING "###,###";MessageNumber&
  219.      CALL MOVETO(225,131):PRINT USING "###,###";BatchCount&
  220.      CALL MOVETO(225,162):PRINT USING "###,###";0
  221.      GOSUB "Cursor_Spin"
  222.  
  223.  
  224. "Import_Routine"
  225.  
  226.  
  227.      a$=GenericFile$:er$="G1"
  228.      ON ERROR GOSUB "File_Error_Trap"
  229.      OPEN "N",5,GenericFile$
  230.      a$=MsgHdrFilename$:er$="H1"
  231.      OPEN "N",1,MsgHdrFilename$,206
  232.      a$=MsgTxtFilename$:er$="T1"
  233.      OPEN "A",2,MsgTxtFilename$
  234.      a$=UserLog$:er$="U1"
  235.      OPEN "N",6,UserLog$,136
  236.  
  237.      DO
  238.  
  239.           DIALOG ON
  240.           DIALOG OFF
  241.           
  242.           a$=GenericFile$:er$="G2"
  243.           LengthHold&=0
  244.           MsgCount&=MsgCount&+1
  245.           LINE INPUT #5,RecordFlag$
  246.           Byte1$=LEFT$(RecordFlag$,1)
  247.           Byte2$=MID$(RecordFlag$,2,1)
  248.           Byte3$=RIGHT$(RecordFlag$,1)
  249.  
  250.           LONG IF UCASE$(Byte1$) = "D"
  251.           LengthHold&=LengthHold&+4
  252.           DeleteCount&=DeleteCount&+1
  253.  
  254. "Message_Skip"
  255.                 LINE INPUT #5,hold$
  256.                 LengthHold&=LengthHold&+LEN(hold$)+1
  257.                 IF hold$=CHR$(0) THEN GOTO "Next_Message"
  258.                 GOTO "Message_Skip"
  259.  
  260.            END IF
  261.  
  262.          ImportCount&=ImportCount&+1
  263.          Position&=LOC(5):Rec%=REC(5)
  264.          NewPosition&=Position&-4
  265.          RECORD #5,Rec%,NewPosition&
  266.          PRINT #5,"D";
  267.          RECORD #5,Rec%,Position&
  268.  
  269.           LINE INPUT #5,Catagory$
  270.           MessageSection%=VAL(Catagory$)
  271.  
  272.           LINE INPUT #5,MessageDate$
  273.           ActualMonth$=LEFT$(MessageDate$,2):ActualMonth%=VAL(ActualMonth$)
  274.           ActualDay$=MID$(MessageDate$,4,2):ActualDay%=VAL(ActualDay$)
  275.           ActualYear$=RIGHT$(MessageDate$,2):ActualYear%=VAL(ActualYear$)
  276.           
  277.           LINE INPUT #5,MessageTime$
  278.           ActualHour1$=LEFT$(MessageTime$,2):ActualHour%=VAL(ActualHour1$)
  279.           ActualMinute1$=MID$(MessageTime$,4,2):ActualMinute%=VAL(ActualMinute1$)
  280.           ActualSecond1$=RIGHT$(MessageTime$,2):ActualSecond%=VAL(ActualSecond1$)
  281.  
  282.           Month1$=LEFT$(DATE$,2):Month%=VAL(Month1$)
  283.           Day1$=MID$(DATE$,4,2):Day%=VAL(Day1$)
  284.           Year1$=RIGHT$(DATE$,2):Year%=VAL(Year1$)
  285.  
  286.           Hour1$=LEFT$(TIME$,2):Hour%=VAL(Hour1$)
  287.           Minute1$=MID$(TIME$,4,2):Minute%=VAL(Minute1$)
  288.           Second1$=RIGHT$(TIME$,2):Second%=VAL(Second1$)
  289.  
  290.           LINE INPUT #5,Node$
  291.           l%=LEN(Node$)
  292.           MessageDestination$=Node$
  293.  
  294.           LINE INPUT #5,MessageFrom$
  295.           LINE INPUT #5,MessageTo$
  296.           LINE INPUT #5,MessageSubject$
  297.  
  298.           LONG IF RIGHT$(MessageTo$,2) = "^P"
  299.                 l%=LEN(MessageTo$)
  300.                 MessageTo$=LEFT$(MessageTo$,l%-2)
  301.                 MessageSection%=EMailArea&
  302.           END IF              
  303.  
  304.           LONG IF RIGHT$(MessageSubject$,2) = "^P"
  305.                 l%=LEN(MessageTo$)
  306.                 MessageSubject$=LEFT$(MessageSubject$,l%-2)
  307.                 MessageSection%=EMailArea&
  308.           END IF              
  309.       
  310.           IF MessageSection%=0 THEN MessageSection%=NetMailArea&
  311.           LONG IF MessageSection% = NetMailArea&
  312.                NetCount& = NetCount&+1
  313.           XELSE
  314.                EchoCount& = EchoCount&+1
  315.           END IF
  316.           MsgCount%(MessageSection%) = MsgCount%(MessageSection%)+1
  317.  
  318.           LengthHold&=LengthHold&+30+LEN(MessageFrom$)+LEN(MessageTo$)+LEN(MessageSubject$)
  319.  
  320.           ' checks for messages addressed to Sysop or System Operator
  321.  
  322.           LONG IF UCASE$(MessageTo$) = "SYSOP" OR UCASE$(MessageTo$) = "SYSTEM OPERATOR"
  323.                MessageTo$=SysopName$
  324.           END IF
  325.  
  326.           ' checks for AREAFIX Request
  327.  
  328.           LONG IF LEFT$(UCASE$(MessageTo$),7)="AREAFIX" AND b5%=2
  329.                Null$=CHR$(0)
  330.                GOSUB "AreaFix"
  331.                GOTO "Screen_Update"
  332.           END IF
  333.  
  334.           ' converts To and From into Upper/Lower Case Syntax
  335.  
  336.           MessageFrom$ = FN LCASE$(MessageFrom$)
  337.           MessageTo$ = FN LCASE$(MessageTo$)
  338.  
  339.           MessageUserHold$=MessageTo$
  340.  
  341.           HighMessage&=HighMessage&+1
  342.           MessageNumber&=HighMessage&
  343.           RecordCount&=RecordCount&+1
  344.           Rct&=RecordCount&
  345.  
  346.  
  347.           MessageOffSet&=MsgTxtBytes&
  348.           ReplyMessageNumber&=0
  349.           MessageLength&=0
  350.           Null$=CHR$(0)
  351.  
  352.  
  353. "MessageBody"
  354.  
  355.           LINE INPUT #5,ln$
  356.           LONG IF ln$=Null$ AND MessageLength&=0
  357.                Hold$=CHR$(6)
  358.                a$=MsgTxtFilename$:er$="T2"
  359.                PRINT #2,Hold$;
  360.                Hold$="      "
  361.                PRINT #2,Hold$;
  362.                MsgTxtBytes&=MsgTxtBytes&+7
  363.                MessageLength&=7
  364.                GOSUB "Message_Record_Write_Conversion"
  365.                GOSUB "Message_Record_Write"
  366.                GOSUB "User_Check"
  367.                GOTO "Next_Message"
  368.           END IF
  369.           LONG IF ln$=Null$
  370.                GOSUB "Message_Record_Write_Conversion"
  371.                GOSUB "Message_Record_Write"
  372.                GOSUB "User_Check"
  373.                GOTO "Next_Message"
  374.           XELSE
  375.                l%=LEN(ln$)
  376.                Hold$=CHR$(l%)
  377.                a$=MsgTxtFilename$:er$="T3"
  378.                PRINT #2,Hold$;
  379.                PRINT #2,ln$;
  380.                MsgTxtBytes&=MsgTxtBytes&+1+l%
  381.                MessageLength&=MessageLength&+1+l%
  382.                GOTO "MessageBody"
  383.           END IF
  384.           ON ERROR RETURN
  385.  
  386. "Next_Message"
  387.  
  388.           GOSUB "Cursor_Spin"
  389.          ' Update Stats on Process Window
  390.  
  391. "Screen_Update"
  392.  
  393.           IF UCASE$(Byte1$)="D" THEN DeleteCount&=DeleteCount&+1
  394.  
  395.           ' Updates Graph on Process Window
  396.  
  397.           PEN,,1,9,3
  398.           BatchCount&=BatchCount&+MessageLength&+LengthHold&
  399.           bar%=200*BatchCount&/ImportByteSize&
  400.           IF bar% >=240 THEN bar%=239
  401.           BOX FILL BarOffSet%+12,250-bar% TO BarOffSet%+1,250
  402.           CALL PENNORMAL
  403.  
  404.           PerMinuteCompute!=(TIMER-PerMinuteStart&)
  405.           MsgPerMin%=BatchCount&/PerMinuteCompute!
  406.           CALL MOVETO(225,99):PRINT USING "###,###";ImportCount&
  407.           CALL MOVETO(225,115):PRINT USING "###,###";MessageNumber&
  408.           CALL MOVETO(225,131):PRINT USING "###,###";BatchCount&
  409.           CALL MOVETO(225,162):PRINT USING "###,###";MsgPerMin%
  410.  
  411.      UNTIL EOF(5)
  412.      CALL MOVETO(364,244):PRINT TIME$
  413.  
  414. "Finished_Exports"
  415.  
  416.      FinishTime&=TIMER
  417.  
  418.      ' Make sure process graph ends at 100%
  419.  
  420.      PEN,,1,9,3
  421.      bar% = 240
  422.      BOX FILL BarOffSet%+12,250-bar% TO BarOffSet%+1,250
  423.      CALL PENNORMAL
  424.  
  425.      CLOSE #1,2,5,6
  426.      GOSUB "Cursor_Spin"
  427.      ScreenLine$="Deleting Generic Import File"
  428.      GOSUB "Screen_Log_Display"
  429.      a$=GenericFile$:er$="GD"
  430.      ON ERROR GOSUB "File_Error_Trap"
  431.      KILL GenericFile$
  432.      ON ERROR RETURN
  433.  
  434.      ScreenLine$="Updating Messages File"
  435.      GOSUB "Screen_Log_Display"
  436.      GOSUB "Cursor_Spin"
  437.  
  438.      a$=MessagesFile$:er$="M1"
  439.      ON ERROR GOSUB "File_Error_Trap"
  440.      OPEN "N",1,MessagesFile$,9242
  441.      ON ERROR RETURN
  442.           GOSUB "Write_Messages_File"
  443.      CLOSE #1
  444.  
  445.     ' Dumps report information to the ImExport Log
  446.  
  447. "Log_Dump"
  448.  
  449.       GOSUB "Cursor_Spin"
  450.       LONG IF b4%=2
  451.           ax&=EchoCount&+NetCount&+DeleteCount&
  452.           ' Opens Import Export Log file and Time Stamps it 
  453.           DEF OPEN "TEXTTmkl"
  454.           a$=ImExportLog$:er$="L1"
  455.           ON ERROR GOSUB "File_Error_Trap"
  456.           OPEN "A",88,ImExportLog$
  457.           LONG IF b3%=2
  458.                GOSUB "Cursor_Spin"
  459.                PRINT #88, StartTime$
  460.                PRINT #88, USING "########";ax&;:PRINT #88," Messages Scanned"
  461.                PRINT #88, USING "########";ImportCount&;:PRINT #88," Messages Imported"
  462.                PRINT #88, USING "########";EchoCount&;:PRINT #88," Echo Messages Imported"
  463.                PRINT #88, USING "########";NetCount&;:PRINT #88," NetMail Messages Imported"
  464.                PRINT #88, USING "########";DeleteCount&;:PRINT #88," Deleted Mail NOT Imported"
  465.                PRINT #88, USING "########";BatchCount&;:PRINT #88," Total Bytes Imported"
  466.                PRINT #88, USING "########";(FinishTime&-StartTime&);:PRINT #88," Elapsed Time (Seconds)"
  467.                PRINT #88, USING "########";MsgPerMin%;:PRINT #88," Bytes Processed Per/Sec"
  468.                PRINT #88, USING "########";OldHighMessage&;:PRINT #88," Starting Message Number"
  469.                PRINT #88, USING "########";HighMessage&;:PRINT #88," Ending Message Number"
  470.                IF AreaFixFlag%=255 THEN PRINT #88, USING "########";AreaFixCount%;:PRINT #88," AreaFix Requests"
  471.                FOR j%= 1 TO 255
  472.                     LONG IF MsgCount%(j%) <> 0
  473.                          PRINT #88, USING "########";MsgCount%(j%);
  474.                          IF MsgName$(j%)="" THEN MsgName$(j%)="Inactive Area"
  475.                          PRINT #88, " ";:PRINT #88,MsgName$(j%)
  476.                     END IF
  477.                NEXT j%
  478.                PRINT #88,TIME$;" ";DATE$;" Import Finish"
  479.                PRINT #88,"---------------"
  480.                GOSUB "Cursor_Spin"
  481.           XELSE
  482.                PRINT #88,USING "####";ImportCount&;" Messages Imported in ";
  483.                PRINT #88,USING "####";(FinishTime&-StartTime&);" seconds at ";TIME$;" ";DATE$
  484.           END IF
  485.           CLOSE #88
  486.           ON ERROR RETURN
  487.           GOSUB "Cursor_Spin"
  488.      END IF
  489.  
  490.      ' Updates the high message #, that was last processed by this routine
  491.      ' Write new High Message Number to STR 1225 in STR Resource.
  492.  
  493.      GOSUB "Cursor_Spin"
  494.      ScreenLine$="Updating Last Message #"
  495.      GOSUB "Screen_Log_Display"
  496.      default$=STR$(HighMessage&)
  497.      default$=RIGHT$(default$,LEN(default$)-1)
  498.      ResourceCount%=1225
  499.      StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  500.      CALL SETSTRING(StrHnd&,default$)
  501.      CALL CHANGEDRESOURCE(StrHnd&)
  502.      CALL UPDATERESFILE(Refnum%)
  503.      GOSUB "Cursor_Spin"
  504.  
  505.      GOSUB "Tabby_Launch"
  506.      GOSUB "Tabby_Launch_Error"
  507.      END
  508.  
  509.  
  510. "AreaFix"
  511.  
  512.       
  513.      TEXT 0,12,0,0     
  514.      T%=128:L%=306:B%=144:R%=453:Temp$="AreaFix Req."
  515.      CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T%, 1)
  516.      TEXT 4,,: ' • Monoco. Plain, 12pt
  517.      AreaFixFlag%=255
  518.      AreaFixCount%=AreaFixCount%+1
  519.      DEF OPEN "TEXTQED1"
  520.      OPEN "A",3,AreaFixFile$
  521.  
  522.      PRINT #3,RecordFlag$
  523.      PRINT #3,Catagory$
  524.      PRINT #3,MessageDate$
  525.      PRINT #3,MessageTime$
  526.      PRINT #3,Node$
  527.      PRINT #3,MessageFrom$
  528.      PRINT #3,MessageTo$
  529.      PRINT #3,MessageSubject$
  530.  
  531. "AreaLoop"
  532.  
  533.      LINE INPUT #5,xln$
  534.      MessageLength&=MessageLength&+1+LEN(xln$)
  535.      PRINT #3,xln$
  536.      LONG IF xln$=Null$
  537.           CLOSE #3
  538.           RETURN
  539.      END IF
  540.      GOTO "AreaLoop"
  541.  
  542.  
  543.  
  544. "User_Check"
  545.  
  546.     ' Checks to see if a MessageTo is addressed to a real users on the
  547.     ' board.  If so then that users Message flag is set, so next time
  548.     ' he logs in he will be notified of the message waiting.
  549.  
  550.      FOR u%= 0 TO UserCount%
  551.          LONG IF UCASE$(MessageUserHold$)=UCASE$(User$(u%)) AND UserFlag$(u%)="0"
  552.               UserFlag$(u%)="1"
  553.               UserRct%=u%
  554.               GOSUB "UserLog_Write"
  555.               u%=UserCount%+99
  556.          END IF
  557.      NEXT u%
  558.      RETURN
  559.              
  560.               
  561.  
  562.  
  563.  
  564. "Message_Record_Write"
  565.  
  566.      ' This module writes the record to the MSGHDR file, for the new message
  567.  
  568.  
  569.      a$=MessagesFile$:er$="M2"
  570.      ON ERROR GOSUB "File_Error_Trap"
  571.      RECORD #1,Rct&
  572.  
  573.      WRITE #1,MessageStatus$;1
  574.      WRITE #1,Reserved1$;1
  575.      WRITE #1,MessageNumber&
  576.      WRITE #1,MessageSection$;1
  577.      WRITE #1,Reserved2$;1
  578.      WRITE #1,Month$;1
  579.      WRITE #1,Day$;1
  580.      WRITE #1,Year$;1
  581.      WRITE #1,Hour$;1
  582.      WRITE #1,Minute$;1
  583.      WRITE #1,Second$;1
  584.      WRITE #1,FromCount$;1
  585.      WRITE #1,MessageFrom$;31
  586.      WRITE #1,ToCount$;1
  587.      WRITE #1,MessageTo$;31
  588.      WRITE #1,SubjectCount$;1
  589.      WRITE #1,MessageSubject$;41
  590.      WRITE #1,DestinationCount$;1
  591.      WRITE #1,MessageDestination$;67
  592.      WRITE #1,MessageOffSet&
  593.      WRITE #1,MessageLength&
  594.      WRITE #1,ReplyMessageNumber&
  595.      WRITE #1,ActualMonth$;1
  596.      WRITE #1,ActualDay$;1
  597.      WRITE #1,ActualYear$;1
  598.      WRITE #1,ActualHour$;1
  599.      WRITE #1,ActualMinute$;1
  600.      WRITE #1,ActualSecond$;1
  601.      ON ERROR RETURN
  602.      GOSUB "Cursor_Spin"
  603.  
  604.      RETURN
  605.  
  606.  
  607.  
  608. "Message_Record_Write_Conversion"
  609.  
  610.      ' This module takes the information read in from the Tabby import file
  611.      ' and converts it into a format acceptable to RRH 2.0
  612.  
  613.      FOR cnt%=0 TO 7
  614.           Bit$(cnt%)="0"
  615.      NEXT cnt%
  616.  
  617.      LONG IF MessageSection%=11
  618.           Bit$(5)="1"
  619.      END IF
  620.   
  621.      Bit$(1)="1": ' Flag as Tabby processed
  622.  
  623.      Reserved1$=MKI$(0)
  624.      Reserved2$=MKI$(0)
  625.  
  626.      l%=LEN(MessageFrom$)
  627.      LONG IF l% > 31
  628.           MessageFrom$=LEFT$(MessageFrom$,31)
  629.      END IF
  630.  
  631.      l%=LEN(MessageTo$)
  632.      LONG IF l% > 31
  633.           MessageTo$=LEFT$(MessageTo$,31)
  634.      END IF
  635.  
  636.      l%=LEN(MessageDestination$)
  637.      LONG IF l% > 67
  638.           MessageDestination$=LEFT$(MessageDestination$,67)
  639.      END IF
  640.  
  641.      l%=LEN(MessageSubject$)
  642.      LONG IF l% > 41
  643.           MessageSubject$=LEFT$(MessageSubject$,41)
  644.      END IF
  645.  
  646.  
  647.      BitHold$=""
  648.      FOR j% = 0 TO 7
  649.          BitHold$=BitHold$+Bit$(j%)
  650.      NEXT j%
  651.      BitHold$="&X"+"00000000"+BitHold$
  652.  
  653.      MessageStatus%=VAL(BitHold$)
  654.      MessageStatus$=MKI$(MessageStatus%):MessageStatus$=RIGHT$(MessageStatus$,1)
  655.      MessageSection$=MKI$(MessageSection%):MessageSection$=RIGHT$(MessageSection$,1)
  656.  
  657.      Month$="":Month$=MKI$(Month%):Month$=RIGHT$(Month$,1)
  658.      Day$="":Day$=MKI$(Day%):Day$=RIGHT$(Day$,1)
  659.      Year$="":Year$=MKI$(Year%):Year$=RIGHT$(Year$,1)
  660.      Hour$="":Hour$=MKI$(Hour%):Hour$=RIGHT$(Hour$,1)
  661.      Minute$="":Minute$=MKI$(Minute%):Minute$=RIGHT$(Minute$,1)
  662.      Second$="":Second$=MKI$(Second%):Second$=RIGHT$(Second$,1)
  663.  
  664.      ActualMonth$=MKI$(ActualMonth%):ActualMonth$=RIGHT$(ActualMonth$,1)
  665.      ActualDay$=MKI$(ActualDay%):ActualDay$=RIGHT$(ActualDay$,1)
  666.      ActualYear$=MKI$(ActualYear%):ActualYear$=RIGHT$(ActualYear$,1)
  667.      ActualHour$=MKI$(ActualHour%):ActualHour$=RIGHT$(ActualHour$,1)
  668.      ActualMinute$=MKI$(ActualMinute%):ActualMinute$=RIGHT$(ActualMinute$,1)
  669.      ActualSecond$=MKI$(ActualSecond%):ActualSecond$=RIGHT$(ActualSecond$,1)
  670.  
  671.      FromCount%=LEN(MessageFrom$)
  672.      FromCount$=MKI$(FromCount%):FromCount$=RIGHT$(FromCount$,1)
  673.      MessageFrom$=LEFT$(MessageFrom$,FromCount%)
  674.  
  675.      ToCount%=LEN(MessageTo$)
  676.      ToCount$=MKI$(ToCount%):ToCount$=RIGHT$(ToCount$,1)
  677.      MessageTo$=LEFT$(MessageTo$,ToCount%)
  678.  
  679.      SubjectCount%=LEN(MessageSubject$)
  680.      SubjectCount$=MKI$(SubjectCount%):SubjectCount$=RIGHT$(SubjectCount$,1)
  681.      MessageSubject$=LEFT$(MessageSubject$,SubjectCount%)
  682.  
  683.      DestinationCount%=LEN(MessageDestination$)
  684.      DestinationCount$=MKI$(DestinationCount%):DestinationCount$=RIGHT$(DestinationCount$,1)
  685.      MessageDestination$=LEFT$(MessageDestination$,DestinationCount%)
  686.  
  687.      RETURN
  688.  
  689.  
  690.  
  691. "Write_Messages_File"
  692.  
  693.      ' This module updates the MESSAGE file with the new High/Low message
  694.      ' numbers and the total bytes in the MSGTXT file.
  695.  
  696.      a$=MessagesFile$:er$="M3"
  697.      ON ERROR GOSUB "File_Error_Trap"
  698.      RECORD #1,0,50
  699.      WRITE #1,LowMessage&
  700.      WRITE #1,HighMessage&
  701.      WRITE #1,MsgTxtBytes&
  702.      ON ERROR RETURN
  703.  
  704. RETURN
  705.  
  706.  
  707.  
  708. "UserLog_Read"
  709.  
  710.     ' This module reads in a user record and stores user name and message
  711.     ' flag status in an array.  This enables quick ram userlog searches and
  712.     ' updates only when necessary with UserLog_Write.  2000 max. users in
  713.     ' this source.
  714.  
  715.      a$=UserLog$:er$="U2"
  716.      ON ERROR GOSUB "File_Error_Trap"
  717.  
  718.     RECORD #6,UserRct%
  719.  
  720.     READ #6,FirstName$;16
  721.     READ #6,LastName$;16
  722.     READ #6,Junk$;62
  723.     READ #6,MessageFlag$;1
  724.     READ #6,Junk2$;41
  725.  
  726.     ON ERROR RETURN
  727.  
  728.     MessageFlag%=CVI(MessageFlag$)
  729.     LONG IF MessageFlag%=0
  730.          MFlag$="0"
  731.     XELSE
  732.          MFlag$="1"
  733.     END IF
  734.     FirstName$=FN MakeString$(FirstName$)
  735.     LastName$=FN MakeString$(LastName$)
  736.    
  737.     User$(UserRct%) = FirstName$+" "+LastName$
  738.     UserFlag$(UserRct%)=MFlag$
  739.  
  740.     RETURN
  741.  
  742.  
  743.  
  744.  
  745. "UserLog_Write"
  746.  
  747.     ' This module updates the Userlog message flag for individual users
  748.     ' that they have mail waiting, when they login next time to the BBS.
  749.  
  750.     MessageFlag$=MKI$(1)
  751.     MessageFlag$=RIGHT$(MessageFlag$,1)
  752.  
  753.     ON ERROR GOSUB "File_Error_Trap"
  754.     a$=UserLog$:er$="U3"
  755.     RECORD #6,UserRct%,94
  756.    
  757.     WRITE #6, MessageFlag$;1
  758.     ON ERROR RETURN
  759.  
  760.     RETURN
  761.  
  762.  
  763. "Config_File_Read_Convert"
  764.  
  765.           GOSUB "Cursor_Spin"
  766.           LONG IF ASC(LEFT$(MsgPath$,1))>0
  767.                MessagesFile$=FN MakeString$(MsgPath$)+":MESSAGES"
  768.           XELSE
  769.                MessagesFile$="MESSAGES": ' Default location
  770.           END IF
  771.  
  772.           LONG IF ASC(LEFT$(CallerLog$,1))>0
  773.                CallerLog$=FN MakeString$(CallerLog$)+":CallerLog"
  774.           XELSE
  775.                CallerLog%=255: ' No CallerLog file being used, so can't write to it
  776.           END IF
  777.  
  778.           LONG IF ASC(LEFT$(UserLog$,1))>0
  779.                UserLog$=FN MakeString$(UserLog$)+":UserLog"
  780.           XELSE
  781.                UserLog$="UserLog": ' Default location where export is
  782.           END IF
  783.  
  784.           LONG IF ASC(LEFT$(SysopName$,1))>0
  785.                SysopName$=FN MakeString$(SysopName$)
  786.           XELSE
  787.                SysopName$="System Operator"
  788.           END IF
  789.  
  790.      RETURN
  791.  
  792.  
  793.  
  794. "Tabby_Launch"
  795.  
  796.      GOSUB "Cursor_Spin"
  797.      EventCount%=0:ERROR=0
  798.  
  799.      ON ERROR GOSUB "AreaFix_Launch_Error"
  800.      LONG IF AreaFixFlag%=255
  801.           RUN AreaFix$
  802.      END IF
  803.      ON ERROR RETURN
  804.      
  805. "PrepareNextLaunch"
  806.  
  807.      EventCount%=0:ERROR=0
  808.      DEF OPEN "TEXTQED1"
  809.  
  810.      ScreenLine$="Checking for Launch.Next File"
  811.      GOSUB "Screen_Log_Display"
  812.  
  813.      OPEN "R",1,NextLaunch$
  814.           Length&=LOF(1,1)
  815.      CLOSE #1
  816.  
  817.      LONG IF Length&=0
  818.           ScreenLine$="File Not Found "+NextLaunch$
  819.           GOSUB "Screen_Log_Display"
  820.           ErrLine$ = "<<Error 01>> *"+NextLaunch$+"* Does not Exist at end of Indicated Path! "
  821.           GOSUB "Error Log"
  822.           KILL NextLaunch$
  823.           GOTO "Launch_Sequence_Start"
  824.      END IF
  825.  
  826.      ScreenLine$="Loading Event Chain"
  827.      GOSUB "Screen_Log_Display"
  828.  
  829.      OPEN "I",1,NextLaunch$
  830.  
  831.      WHILE NOT EOF(1)
  832.  
  833.           GOSUB "Cursor_Spin"
  834.           INPUT #1,Tabby$(EventCount%)
  835.           EventCount%=EventCount%+1
  836.  
  837.      WEND
  838.      CLOSE #1
  839.      GOSUB "Cursor_Spin"
  840.  
  841.      EventCount%=EventCount%-1
  842.  
  843.      T%=128:L%=306:B%=144:R%=453:Temp$=Tabby$(0)
  844.      CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T%, 1)
  845.  
  846.      LONG IF EventCount% < 1
  847.           ScreenLine$="Last Event Deleting Launch.Next "
  848.           GOSUB "Screen_Log_Display"
  849.           KILL NextLaunch$
  850.      XELSE
  851.           ScreenLine$="Updating Launch.Next File "
  852.           GOSUB "Screen_Log_Display"
  853.           GOSUB "Cursor_Spin"
  854.           OPEN "O",1,NextLaunch$
  855.               FOR Count%= 1 TO EventCount%
  856.                    PRINT #1,Tabby$(Count%);
  857.                    GOSUB "Cursor_Spin"
  858.                    LONG IF Tabby$(Count%+1) = ""
  859.                         PRINT #1,CHR$(13);
  860.                    XELSE
  861.                         PRINT #1,",";
  862.                    END IF
  863.               NEXT Count%
  864.           CLOSE #1
  865.      END IF
  866.  
  867. "Launch_Sequence_Start"
  868.  
  869.      LaunchFile$=BBSFolder$+Tabby$(0)
  870.  
  871.      IF UCASE$(Tabby$(0))="BBS" THEN LaunchFile$=RRHost$
  872.  
  873.      GOSUB "Check_Valid_Filenames"
  874.  
  875.      ON ERROR GOSUB "Tabby_Launch_Error"
  876.  
  877.      LONG IF Tabby$(0) <> ""
  878.  
  879.           GOSUB "Cursor_Spin"
  880.           ScreenLine$="Launching - "+LaunchFile$
  881.           GOSUB "Screen_Log_Display"
  882.  
  883.           CURSOR 0
  884.           LONG IF FileErr1%=255
  885.                ScreenLine$="File Not Found - "+LaunchFile$
  886.                GOSUB "Screen_Log_Display"
  887.                ErrLine$ = "<<Error 02>> *"+LaunchFile$+"* Does not Exist at end of Indicated Path! "
  888.                GOSUB "Error Log"
  889.                ErrLine$ = "             "+"Attempt is being Made to Run *"+RRHost$+"* "
  890.                GOSUB "Error Log"
  891.  
  892.                ScreenLine$="Launching BBS - "+RRHost$
  893.                GOSUB "Screen_Log_Display"
  894.                LONG IF FileErr2%=0
  895.                     ScreenLine$="BBS Not Found - "+RRHost$
  896.                     GOSUB "Screen_Log_Display"
  897.                     ErrLine$ = "<<Error 03>> "+RRHost$+" Does not Exist at end of Indicated Path! "
  898.                     GOSUB "Error Log"
  899.                     ErrLine$ = "             "+"Attempt is being Made to Run *"+TabbyNet$+"* "
  900.                     GOSUB "Error Log"
  901.  
  902.                     ScreenLine$="Launching TabbyNet - "+TabbyNet$
  903.                     GOSUB "Screen_Log_Display"
  904.                     LONG IF FileErr3%=255
  905.                          ScreenLine$="TabbyNet Not Found - "+TabbyNet$
  906.                          GOSUB "Screen_Log_Display"
  907.                          ErrLine$ = "<<Error 04>> *"+TabbyNet$+"* Does not Exist at end of Indicated Path! "
  908.                          GOSUB "Error Log"
  909.                          GOSUB "Tabby_Launch_Error"
  910.                          END
  911.                     XELSE
  912.                          RUN TabbyNet$
  913.                          END
  914.                     END IF
  915.                XELSE
  916.                     RUN RRHost$
  917.                     END
  918.                END IF
  919.           XELSE
  920.                RUN LaunchFile$
  921.                END
  922.           END IF
  923.  
  924.       XELSE
  925.  
  926.           CURSOR 0
  927.           ScreenLine$="Last Event Launching BBS - "+RRHost$
  928.           GOSUB "Screen_Log_Display"
  929.           LONG IF FileErr2%=255
  930.                ScreenLine$="BBS Not Found - "+RRHost$
  931.                GOSUB "Screen_Log_Display"
  932.                ErrLine$ = "<<Error 05>> *"+RRHost$+"* Does not Exist at end of Indicated Path! "
  933.                GOSUB "Error Log"
  934.                ErrLine$ = "             "+"Attempt is being Made to Run *"+TabbyNet$+"* "
  935.                GOSUB "Error Log"
  936.  
  937.                ScreenLine$="Launching TabbyNet - "+TabbyNet$
  938.                GOSUB "Screen_Log_Display"
  939.                LONG IF FileErr3%=255
  940.                     ScreenLine$="TabbyNet Not Found - "+TabbyNet$
  941.                     GOSUB "Screen_Log_Display"
  942.                     ErrLine$ = "<<Error 06>> *"+TabbyNet$+"* Does not Exist at end of Indicated Path! "
  943.                     GOSUB "Error Log"
  944.                     GOSUB "Tabby_Launch_Error"
  945.                     END
  946.                XELSE
  947.                     RUN TabbyNet$
  948.                     END
  949.                END IF
  950.           XELSE
  951.                RUN RRHost$
  952.                END
  953.           END IF
  954.  
  955.      END IF
  956.  
  957.      CURSOR 0
  958.      ErrLine$ = "<<Error 99>> "+" Really Big ERROR, Sequence Abort, attempting to Recover "
  959.      GOSUB "Error Log"
  960.      ScreenLine$="Launch Sequence Error, Running "+RRHost$
  961.      GOSUB "Screen_Log_Display"
  962.      LONG IF FileErr2%=255
  963.           ScreenLine$="BBS Not Found - "+RRHost$
  964.           GOSUB "Screen_Log_Display"
  965.           ErrLine$ = "<<Error 07>> "+RRHost$+" Does not Exist at end of Indicated Path! "
  966.           GOSUB "Error Log"
  967.           ErrLine$ = "             "+"Attempt is being Made to Run *TabbyNet* "
  968.           GOSUB "Error Log"
  969.  
  970.           ScreenLine$="Launching TabbyNet - "+TabbyNet$
  971.           GOSUB "Screen_Log_Display"
  972.           
  973.           LONG IF FileErr3%=255
  974.                ScreenLine$="TabbyNet Not Found - "+TabbyNet$
  975.                GOSUB "Screen_Log_Display"
  976.                ErrLine$ = "<<Error 08>> *"+TabbyNet$+"* Does not Exist at end of Indicated Path! "
  977.                GOSUB "Error Log" 
  978.                GOSUB "Tabby_Launch_Error"
  979.                END
  980.           XELSE
  981.                RUN TabbyNet$
  982.                END
  983.           END IF
  984.           RUN RRHost$
  985.           END
  986.      END IF
  987.  
  988.      ON ERROR RETURN
  989.  
  990.      RETURN  
  991.  
  992.  
  993. "Check_Valid_Filenames"
  994.     
  995.      ErrFile%=0:FileErr1%=0:FileErr2%=0:FileErr3%=0
  996.  
  997.      ON ERROR GOSUB "Filename_Error"
  998.    
  999.      a%=1
  1000.      GOSUB "Cursor_Spin"
  1001.      OPEN "I",2,LaunchFile$
  1002.      CLOSE #2     
  1003.      LONG IF FileErr1%=255
  1004.           ErrLine$="<<Error 09>> *"+LaunchFile$+"* Next Event Not Found - Invalid Name or Path "
  1005.           GOSUB "Error Log"
  1006.           ScreenLine$="File Error <NOT FOUND> *"+LaunchFile$+"* "
  1007.           GOSUB "Screen_Log_Display"
  1008.      END IF
  1009.  
  1010.      a%=2
  1011.      GOSUB "Cursor_Spin"
  1012.      OPEN "I",2,RRHost$
  1013.      CLOSE #2
  1014.      LONG IF FileErr2%=255
  1015.           ErrLine$="<<Error 10>> *"+RRHost$+"* BBS Not Found - Invalid Name or Path "
  1016.           GOSUB "Error Log"
  1017.           ScreenLine$="File Error <NOT FOUND> *"+RRHost$+"* "
  1018.           GOSUB "Screen_Log_Display"
  1019.      END IF
  1020.  
  1021.      a%=3
  1022.      OPEN "I",2,TabbyNet$
  1023.      CLOSE #2
  1024.      GOSUB "Cursor_Spin"
  1025.      LONG IF FileErr3%=255
  1026.           ErrLine$="<<Error 11>> *"+TabbyNet$+"* TabbyNet Not Found - Invalid Name or Path "
  1027.           GOSUB "Error Log"
  1028.           ScreenLine$="File Error <NOT FOUND> *"+TabbyNet$+"* "
  1029.           GOSUB "Screen_Log_Display"
  1030.      END IF
  1031.  
  1032.      ON ERROR RETURN
  1033.      RETURN
  1034.  
  1035.  
  1036.  
  1037. "Filename_Error"
  1038.  
  1039.      IF a%=1 THEN FileErr1%=255
  1040.      IF a%=2 THEN FileErr2%=255
  1041.      IF a%=3 THEN FileErr3%=255
  1042.      ERROR=0
  1043.  
  1044.      RETURN
  1045.  
  1046.  
  1047. "Get_File_Info"
  1048.  
  1049.      ScreenLine$="Loading for Generic File"
  1050.      GOSUB "Screen_Log_Display"
  1051.      NextEventError%=0
  1052.  
  1053.      a$=GenericFile$:er$="G3"
  1054.      ON ERROR GOSUB "File_Error_Trap"
  1055.      OPEN "I",1,GenericFile$
  1056.           INPUT #1,x$
  1057.       CLOSE #1
  1058.       GenericFile$=x$+"Generic Import"
  1059.       ON ERROR RETURN
  1060.  
  1061.      ScreenLine$="Loading for Config File"
  1062.      GOSUB "Screen_Log_Display"
  1063.      a$=ConfigFile$:er$="C1"
  1064.      ON ERROR GOSUB "File_Error_Trap"
  1065.      OPEN "N",1,ConfigFile$
  1066.      ON ERROR RETURN
  1067.           GOSUB "Config_File_Read"
  1068.      CLOSE #1
  1069.  
  1070.      ScreenLine$="Checking Generic Import Size"
  1071.      GOSUB "Screen_Log_Display"
  1072.      a$=GenericFile$:er$="G4"
  1073.      ON ERROR GOSUB "File_Error_Trap"
  1074.      OPEN "R",1,GenericFile$
  1075.      ON ERROR RETURN
  1076.           ImportByteSize&=LOF(1,1)
  1077.      CLOSE #1
  1078.  
  1079.      ' No file Found to Process - Exit/Quit
  1080.      LONG IF ImportByteSize&=0
  1081.           ScreenLine$="No Generic Generic Import File"
  1082.           GOSUB "Screen_Log_Display"
  1083.           GOSUB "Tabby_Launch"
  1084.           GOSUB "Tabby_Launch_Error"
  1085.      END IF
  1086.  
  1087.  
  1088.      ScreenLine$="Loading User Information"
  1089.      GOSUB "Screen_Log_Display"
  1090.      a$=UserLog$:er$="U1"
  1091.      ON ERROR GOSUB "File_Error_Trap"
  1092.      OPEN "N",#6,UserLog$,136
  1093.      ON ERROR RETURN
  1094.      WHILE NOT EOF(6)
  1095.           GOSUB "UserLog_Read"
  1096.           UserRct% = UserRct%+1
  1097.           IF UserRct%=2001 THEN GOTO "UserReadDone":   ' Only takes first 2000 users
  1098.      WEND
  1099. "UserReadDone"
  1100.      CLOSE #6
  1101.      UserCount%=UserRct%-1
  1102.  
  1103.  
  1104.      ScreenLine$="Loading Messages Information"
  1105.      GOSUB "Screen_Log_Display"
  1106.      a$=MessagesFile$:er$="M4"
  1107.      ON ERROR GOSUB "File_Error_Trap"
  1108.      OPEN "N",1,MessagesFile$
  1109.      ON ERROR RETURN
  1110.           GOSUB "Read_Messages_File"
  1111.      CLOSE #1
  1112.  
  1113.  
  1114.      ' This opens the MSGDHR File with length 206 
  1115.      ' At this point we will determine how many records
  1116.      ' there are in the file
  1117.  
  1118.      MsgHdrFilename$=MsgHdrTxtPath$+":"+"MSGHDR": ' Path to MSGHDR file
  1119.      MsgTxtFilename$=MsgHdrTxtPath$+":"+"MSGTXT": ' Path to MSGTXT file
  1120.  
  1121.      ScreenLine$="Preparing MsgHdr File"
  1122.      GOSUB "Screen_Log_Display"
  1123.      a$=MsgHdrFilename$:er$="H4"
  1124.      ON ERROR GOSUB "File_Error_Trap"
  1125.      OPEN "N",1,MsgHdrFilename$,206
  1126.      ON ERROR RETURN
  1127.      MSGHDRBytes&= LOF(1,1):                ' Get total number of bytes
  1128.      RecordCount&=(MSGHDRBytes&/206)-1:     ' -1 to adjust for the Zero Record
  1129.      IF RecordCount& < 0 THEN RecordCount&=0
  1130.      CLOSE #1
  1131.      RETURN
  1132.  
  1133.  
  1134.  
  1135. "Read_Messages_File"
  1136.  
  1137.      ' This routine reads in necessary information from the MESSAGE File
  1138.      ' NOTE: in this version message section length size would be set the
  1139.      '       maximum in RRH - at the writing of this that is 400 lines.
  1140.      
  1141.      ' No checks are made to insure that the body of the message does not
  1142.      ' exceed 400 lines.  It is assumed that Tabby will regulate this.
  1143.  
  1144.      
  1145.      l%=LOF(1,1)
  1146.      LONG IF l% <> 9242
  1147.           a$=MessagesFile$:er$="MS" 
  1148.           GOSUB "File_Error_Trap"
  1149.           GOSUB "Tabby_Launch"
  1150.           GOSUB "Tabby_Launch_Error"
  1151.           END
  1152.      END IF
  1153.      
  1154.      a$=Messages$:er$="M5"
  1155.      ON ERROR GOSUB "File_Error_Trap"
  1156.      READ #1,PathCount$;1
  1157.      READ #1,MsgHdrTxtPath$;49
  1158.      READ #1,LowMessage&
  1159.      READ #1,HighMessage&
  1160.      READ #1,MsgTxtBytes&
  1161.  
  1162.      ' Loop here to get section types
  1163.      
  1164.      FOR j%=1 TO 255
  1165.          READ #1,SectionNameCount$;1
  1166.          READ #1,MsgSectionName$;25
  1167.          READ #1,SecurityLevel$;1:           ' Not used here
  1168.          READ #1,Modifiers$;1:               ' Not used here
  1169.          READ #1,MaxSectionLength%:          ' Not used here - Set at Max in RRH
  1170.          READ #1,RestrictionFlags&:          ' Not used here
  1171.          READ #1,RestrictionFlagModifier$;1: ' Not used here
  1172.          READ #1,SectionType$;1
  1173.    
  1174.          ' Moves Message Identifier 0,1,2,3,4 into MessageSection$(x)
  1175.     
  1176.          SectionType%=CVI(SectionType$)
  1177.          TempHold$=STR$(SectionType%)
  1178.          MessageSection$(j%)=RIGHT$(TempHold$,1)
  1179.          slen%=CVI(SectionNameCount$)
  1180.          MsgName$(j%)=LEFT$(MsgSectionName$,slen%)
  1181.      NEXT j%
  1182.      ON ERROR RETURN
  1183.  
  1184.      ' Moves valid data into MsgHdrTxtPath&
  1185.  
  1186.      PathCount%=CVI(PathCount$)
  1187.      MsgHdrTxtPath$=LEFT$(MsgHdrTxtPath$,PathCount%)
  1188.  
  1189.      RETURN
  1190.  
  1191.  
  1192. "Config_File_Read"
  1193.  
  1194.      a$=ConfigFile$:er$="C2"
  1195.      ON ERROR GOSUB "File_Error_Trap"
  1196.  
  1197.      READ #1, Ignore$;57
  1198.      READ #1, UserLog$;41
  1199.      READ #1, CallerLog$;41
  1200.      READ #1, MsgPath$;80
  1201.      READ #1, Ignore$;89
  1202.      READ #1, LaunchTimeOld&
  1203.      READ #1, Ignore$;5
  1204.      READ #1, SysopName$;31
  1205.      
  1206.      ON ERROR RETURN
  1207.  
  1208.           LONG IF ASC(LEFT$(MsgPath$,1))>0
  1209.                MessagesFile$=FN MakeString$(MsgPath$)+":MESSAGES"
  1210.           XELSE
  1211.                MessagesFile$=BBSFolder$+"MESSAGES": ' Default location
  1212.           END IF
  1213.  
  1214.           LONG IF ASC(LEFT$(CallerLog$,1))>0
  1215.                CallerLog$=FN MakeString$(CallerLog$)+":CallerLog"
  1216.           XELSE
  1217.                CallerLog%=255: ' No CallerLog file being used, so can't write to it
  1218.           END IF
  1219.  
  1220.           LONG IF ASC(LEFT$(UserLog$,1))>0
  1221.                UserLog$=FN MakeString$(UserLog$)+":UserLog"
  1222.           XELSE
  1223.                UserLog$=BBSFolder$+"UserLog": ' Default location where export is
  1224.           END IF
  1225.  
  1226.           LONG IF ASC(LEFT$(SysopName$,1))>0
  1227.                SysopName$=FN MakeString$(SysopName$)
  1228.           XELSE
  1229.                SysopName$="System Operator"
  1230.           END IF
  1231.  
  1232.      RETURN
  1233.  
  1234.  
  1235.  
  1236. "File_Error_Trap"
  1237.  
  1238.      GOSUB "Cursor_Spin"
  1239.      ScreenLine$="*"+a$+"* file not found or damaged"
  1240.      GOSUB "Screen_Log_Display"
  1241.      GOSUB "Cursor_Spin"
  1242.      ErrLine$="<<Error "+er$+">> *"+a$+"* file problems, Not found at path or damaged "
  1243.      GOSUB "Error Log"
  1244.      ERROR=0
  1245.      GOSUB "Tabby_Launch"
  1246.      GOSUB "Tabby_Launch_Error"
  1247.      END
  1248.      RETURN
  1249.  
  1250.  
  1251. "Screen_Log_Display"
  1252.  
  1253.      TEXT 0,12,0,0     
  1254.      T%=211:L%=115:B%=227:R%=450:Temp$=ScreenLine$
  1255.      CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T%, 1)
  1256.      GOSUB "Cursor_Spin"
  1257.      RETURN
  1258.  
  1259.  
  1260. "Error Log"
  1261.  
  1262.      GOSUB "Cursor_Spin"
  1263.      DEF OPEN "TEXTTImp"
  1264.      OPEN "A",9,"Import.Error"
  1265.           GOSUB "Cursor_Spin"
  1266.           ErrLine$=ErrLine$+TIME$+" "+DATE$
  1267.           PRINT #9, ErrLine$
  1268.      CLOSE #9
  1269.      RETURN
  1270.      
  1271.  
  1272.  
  1273. "Cursor_Spin"
  1274.  
  1275.      Cur%=Cur%+1
  1276.      IF Cur% > 131 THEN Cur%=128
  1277.      CURSOR Cur%
  1278.      RETURN
  1279.  
  1280.  
  1281.      
  1282. "Tabby_Launch_Error"
  1283.  
  1284.      GOSUB "Cursor_Spin"
  1285.      ScreenLine$="** Dropping to Finder, Launch Error **"
  1286.      GOSUB "Screen_Log_Display"
  1287.      ErrLine$="<<Error"+STR$(ERROR)+">> Launch Error Possible Causes are as Follows: "
  1288.      GOSUB "Error Log"
  1289.      ErrLine$="<<---------- BBS String - "+RRHost$+" "
  1290.      GOSUB "Error Log"
  1291.      ErrLine$="<<---------- BBS FolderString - "+BBSFolder$+" "
  1292.      GOSUB "Error Log"
  1293.      GOSUB "Cursor_Spin"
  1294.      ErrLine$="<<-- Launch.Next String - "+NextLaunch$+" "
  1295.      GOSUB "Error Log"
  1296.      ErrLine$="<<----- TabbyNet String - "+TabbyNet$+" "
  1297.      GOSUB "Error Log"
  1298.      GOSUB "Cursor_Spin"
  1299.      ErrLine$="<<--- BBS Folder String - "+BBSFolder$+" "
  1300.      GOSUB "Error Log"
  1301.      ErrLine$="<<---- Messages String - "+MessagesFile$+" "
  1302.      GOSUB "Error Log"
  1303.      ErrLine$="<<---- MSGHDR String - "+MsgHdrFilename$+" "
  1304.      GOSUB "Error Log"
  1305.      ErrLine$="<<-- One of the Above is Wrong! - Application Not There! - Invalid Pathname! - Can't Run A File! "
  1306.      GOSUB "Error Log"
  1307.      ErrLine$="<<---- Generic String - "+Generic$+" "
  1308.      GOSUB "Error Log"
  1309.      ErrLine$="*    *** Dropping to Finder, I am Confuzzzzzzed @%?$-*$%! "
  1310.      GOSUB "Error Log"
  1311.      ERROR = 0
  1312.      CURSOR 0
  1313.      IF rscs%=1 THEN rscs%=0:CALL CLOSERESFILE(Refnum%)
  1314.      END
  1315.      RETURN
  1316.  
  1317.  
  1318.  
  1319. "Build_Main_Window"
  1320.  
  1321.      GOSUB "Cursor_Spin"
  1322.      IF WND=1 THEN WINDOW 1,"",(8,45)-(502,310),-17
  1323.  
  1324.      CALL PENNORMAL
  1325.  
  1326.      ' • Draws the Main Rectangle for the % Graph
  1327.  
  1328.      T%=10:L%=15:B%=251:R%=36
  1329.      CALL FRAMERECT(T%)
  1330.  
  1331.      ' • Draws the % Break Lines on the Graph
  1332.  
  1333.      R%=47:' • Extends the Break Lines 11 Pixels to the Right
  1334.  
  1335.      FOR J% = T TO 250 STEP 24
  1336.           CALL MOVETO(L%,J%):CALL LINETO(R%,J%)
  1337.      NEXT J%
  1338.  
  1339.      ' • Draws Internal White Break Box In % Graph
  1340.  
  1341.      T%=32:L%=22:B%=228:R%=31:PEN ,,,,19
  1342.      CALL PAINTRECT(T%)
  1343.  
  1344.      ' • Draws in Percent Labels on the % Graph
  1345.  
  1346.      TEXT 3,9,1,0: ' • Geneva, Bold, 9 pt
  1347.      T%=4:L%=45:B%=16:R%=78:Percent%=100
  1348.  
  1349.      FOR j%= 4 TO 244 STEP 24
  1350.           Temp$=RIGHT$(STR$(Percent%),LEN(STR$(Percent%))-1)+"%"
  1351.           T%=j%:B%=j%+12:' • Must off set the bottom value by 12
  1352.           IF Percent%=0 THEN Temp$=" "+Temp$
  1353.           Percent%=Percent%-10
  1354.           CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T%, 1)
  1355.      NEXT j%
  1356.  
  1357.      ' • Draws in the Text Headers for the current file status
  1358.  
  1359.      TEXT 4,12,0:' • Monoco, Plain, 12pt - Need equal spaced letters
  1360.      T%=23:L%=92:B%=167:R%=214
  1361.      Temp$="High Message #:"+CHR$(13)+"Low Message #:"+CHR$(13)+"Last Message #:"+CHR$(13)+""+CHR$(13)+"Msgs Imported:"+CHR$(13)+"Current Msg #:"+CHR$(13)+"Total Bytes:"+CHR$(13)+""+CHR$(13)+"Bytes Per/Sec:"
  1362.      CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T%,-1)
  1363.  
  1364.  
  1365.      ' • Backgound Black for Message Line
  1366.  
  1367.      CALL PENNORMAL
  1368.      T%=206:L%=114:B%=238:R%=460:PEN 1,1,1,8
  1369.      CALL PAINTROUNDRECT(T%,16,16)
  1370.      
  1371.  
  1372.      ' • White Forground and Frame Message Line
  1373.  
  1374.      GOSUB "Cursor_Spin"
  1375.      T%=203:L%=111:B%=235:R%=457
  1376.      PEN ,,,,19:CALL PAINTROUNDRECT(T%,16,16)
  1377.      PEN ,,,,0:CALL FRAMEROUNDRECT(T%,16,16)
  1378.  
  1379.  
  1380.      ' • Background for Version Application Name Box
  1381.  
  1382.      T%=20:L%=332:B%=67:R%=469
  1383.      CALL PAINTROUNDRECT(T%,16,16)
  1384.  
  1385.  
  1386.      ' • White Forground and Frame for Version Application Name Box
  1387.  
  1388.      T%=16:L%=329:B%=64:R%=466
  1389.      PEN ,,,,19:CALL PAINTROUNDRECT(T%,16,16)
  1390.      PEN ,,,,0:CALL FRAMEROUNDRECT(T%,16,16)
  1391.  
  1392.  
  1393.      ' • Background for Front Author Name Box
  1394.  
  1395.      T%=45:L%=308:B%=92:R%=441
  1396.      CALL PAINTROUNDRECT(T%,16,16)
  1397.  
  1398.  
  1399.      ' • White Forground and Frame for Author Name Box
  1400.  
  1401.      T%=41:L%=305:B%=89:R%=438
  1402.      PEN ,,,,19:CALL PAINTROUNDRECT(T%,16,16)
  1403.      PEN ,,,,0:CALL FRAMEROUNDRECT(T%,16,16)
  1404.  
  1405.  
  1406.      ' • Background for Next Launch Application Name Box
  1407.  
  1408.      T%=126:L%=308:B%=152:R%=456
  1409.      CALL PAINTROUNDRECT(T%,16,16)
  1410.  
  1411.  
  1412.      ' • White Forground and Frame Next Launch Application Box
  1413.  
  1414.      T%=123:L%=305:B%=149:R%=454
  1415.      PEN ,,,,19:CALL PAINTROUNDRECT(T%,16,16)
  1416.      PEN ,,,,0:CALL FRAMEROUNDRECT(T%,16,16)
  1417.  
  1418.  
  1419.      ' • Background for Bottom Time Box
  1420.  
  1421.      T%=232:L%=351:B%=253:R%=438:PEN ,,,,0
  1422.      CALL PAINTROUNDRECT(T%,16,16)
  1423.  
  1424.  
  1425.      ' • White Forground and Frame for Bottom Time Box
  1426.  
  1427.      T%=229:L%=348:B%=250:R%=436
  1428.      PEN ,,,,19:CALL PAINTROUNDRECT(T%,16,16)
  1429.      PEN ,,,,0:CALL FRAMEROUNDRECT(T%,16,16)
  1430.  
  1431.  
  1432.      ' • Background for Top Time Box
  1433.  
  1434.      T%=188:L%=351:B%=209:R%=438:PEN ,,,,0
  1435.      CALL PAINTROUNDRECT(T%,16,16)
  1436.  
  1437.  
  1438.      ' • White Forground and Frame for Top Time Box
  1439.  
  1440.      T%=185:L%=348:B%=206:R%=436
  1441.      PEN ,,,,19:CALL PAINTROUNDRECT(T%,16,16)
  1442.      PEN ,,,,0:CALL FRAMEROUNDRECT(T%,16,16)
  1443.  
  1444.  
  1445.      TEXT 0,,:' • System Defalt font Chicage 12pt
  1446.      T%=20:L%=331:B%=36:R%=464:Temp$="Import Engine 2.55"
  1447.      CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T%, 1)
  1448.      T%=49:L%=310:B%=81:R%=432:Temp$="Written by"+CHR$(13)+"Michael Lininger"
  1449.      CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T%, 1)
  1450.      T%=128:L%=306:B%=144:R%=453:Temp$="Aurora Borealis"
  1451.      CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T%, 1)
  1452.      TEXT 4,,: ' • Monoco. Plain, 12pt
  1453.      T%=188:L%=361:B%=204:R%=419:Temp$=TIME$
  1454.      CALL TEXTBOX(VARPTR(Temp$)+1,LEN(Temp$),T%, 1)
  1455.      GOSUB "Cursor_Spin"
  1456.  
  1457.      
  1458. RETURN
  1459.  
  1460.  
  1461.  
  1462. "Get_Resource_Values"
  1463.  
  1464.      ' This module Gets default values from STR resources
  1465.      ' 1220 = BBS Application Name (Red Ryder Host)
  1466.      ' 1221 = BBS Folder Pathname (dd80:bbs:)
  1467.      ' 1222 = ImExport Log Full Pathname (dd80:bbs:Log:ImExport Log)
  1468.      ' 1223 = AreaFix Application Name (AreaFix)
  1469.      ' 1224 = value for Netmail Message Section Number (11)
  1470.      ' 1225 = value for last Message Number processed (9650)
  1471.      ' 1226 = Log Turned On/Off (2/1)
  1472.      ' 1227 = Full Log On/Off (2/1)
  1473.      ' 1228 = Turn on AreaFix  On/Off (2/1)
  1474.      
  1475.      ScreenLine$="Loading Resource STRs"
  1476.      GOSUB "Screen_Log_Display"
  1477.  
  1478.      ' Find out what this application is named
  1479.  
  1480.       GOSUB "Cursor_Spin"
  1481.       CurApName=&H910
  1482.       CurApName$=""
  1483.  
  1484.       FOR I%=1 TO PEEK(CurApName)
  1485.                  CurApName$=CurApName$+CHR$(PEEK(CurApName+I%))
  1486.       NEXT I%
  1487.  
  1488.       GOSUB "Cursor_Spin"
  1489.  
  1490.       rscs%=0:' ResFile is Closed
  1491.       Refnum%=FN OPENRESFILE(CurApName$)
  1492.       Errnum%=FN RESERROR
  1493.  
  1494.       LONG IF Errnum% <> 0
  1495.            ScreenLine$="Resource Problem with "+CurApName$
  1496.            GOSUB "Screen_Log_Display"
  1497.            ErrLine$ = "<<Error RS>> *"+CurApName$+"* has a resource fork problem, Can't Open, Find STRs "
  1498.            GOSUB "Error Log"
  1499.            GOSUB "Tabby_Launch"
  1500.            GOSUB "Tabby_Launch_Error"
  1501.            END
  1502.       END IF 
  1503.  
  1504.      rscs%=1:' ResFile is Open
  1505.      FOR ResourceCount%=1220 TO 1228
  1506.  
  1507.           GOSUB "Cursor_Spin"
  1508.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1509.  
  1510.           LONG IF StrHnd&=0
  1511.  
  1512.               ' Setting up string resource to save default strs
  1513.  
  1514.               IF ResourceCount% = 1220 THEN Str$="Red Ryder Host"
  1515.               IF ResourceCount% = 1221 THEN Str$=":"
  1516.               IF ResourceCount% = 1222 THEN Str$="Import Log"
  1517.               IF ResourceCount% = 1223 THEN Str$="AreaFix"
  1518.               IF ResourceCount% = 1224 THEN Str$="1,1"
  1519.               IF ResourceCount% = 1225 THEN Str$="0"
  1520.               IF ResourceCount% = 1226 THEN Str$="2"
  1521.               IF ResourceCount% = 1227 THEN Str$="2"
  1522.               IF ResourceCount% = 1228 THEN Str$="2"
  1523.               
  1524.                  StrHnd&=FN NEWSTRING(Str$)
  1525.                 CALL ADDRESOURCE (StrHnd&,CVI("STR "),ResourceCount%,"")
  1526.           XELSE
  1527.                   StrHnd&=FN GETSTRING(ResourceCount%)
  1528.           END IF
  1529.  
  1530.  
  1531.           ' Convert STRs into useful limit values and pathnames
  1532.  
  1533.           Default$=FN ReturnString$(StrHnd&)
  1534.      
  1535.          IF ResourceCount% = 1220 THEN RRHost$=Default$
  1536.          IF ResourceCount% = 1221 THEN BBSFolder$=Default$
  1537.          IF ResourceCount% = 1222 THEN ImExportLog$=Default$
  1538.          IF ResourceCount% = 1223 THEN AreaFix$=Default$
  1539.          LONG IF ResourceCount% = 1224
  1540.                a%=INSTR(1,Default$,",")
  1541.                                                    NetMailArea&=VAL(LEFT$(Default$,a%-1))
  1542.                EMailArea& = VAL(MID$(Default$,a%+1,3))
  1543.                NetMailArea$=Default$
  1544.          END IF
  1545.          IF ResourceCount% = 1225 THEN OldHighMessage&=VAL(Default$):OldHighMessage$=Default$
  1546.          IF ResourceCount% = 1226 THEN b3%=VAL(Default$) 
  1547.          IF ResourceCount% = 1227 THEN b4%=VAL(Default$) 
  1548.          IF ResourceCount% = 1228 THEN b5%=VAL(Default$) 
  1549.  
  1550.      NEXT ResourceCount%
  1551.        
  1552.  
  1553. RETURN
  1554.  
  1555.  
  1556. "Configure Menu"
  1557.  
  1558.      Field%=1:CURSOR 0
  1559.      WINDOW CLOSE #1
  1560.      WND=1:GOSUB "Build Window"
  1561.  
  1562.      ON DIALOG GOSUB "Handle Dialog"
  1563.      DIALOG ON
  1564.  
  1565. "Loop"
  1566.  
  1567.     LONG IF Button%=1
  1568.          WINDOW CLOSE #1
  1569.          RETURN
  1570.     END IF
  1571.     LONG IF Button%=2
  1572.          GOSUB "Resource Update"
  1573.          WINDOW CLOSE #1
  1574.          RETURN
  1575.      END IF
  1576.  
  1577.      GOTO "Loop"
  1578.      DIALOG OFF
  1579.  
  1580.  
  1581. "Handle Dialog"
  1582.  
  1583.      Act%=DIALOG(0):Ref%=DIALOG(Act%)
  1584.  
  1585.      IF Act%=3 THEN WINDOW Ref%:RETURN
  1586.      LONG IF Act%=1 AND Ref%=1
  1587.           Button%=2
  1588.      END IF
  1589.      LONG IF Act%=1 AND Ref%=2
  1590.           Button%=1
  1591.      END IF
  1592.      LONG IF Act%=1 AND Ref%=3
  1593.           LONG IF b3%=2
  1594.                b3%=1
  1595.           XELSE 
  1596.                b3%=2
  1597.           END IF
  1598.           BUTTON 3 ,b3%
  1599.      END IF
  1600.      LONG IF Act%=1 AND Ref%=4
  1601.           LONG IF b4%=2
  1602.                b4%=1
  1603.           XELSE 
  1604.                b4%=2
  1605.           END IF
  1606.           BUTTON 4 ,b4%
  1607.      END IF
  1608.      LONG IF Act%=1 AND Ref%=5
  1609.           LONG IF b5%=2
  1610.                b5%=1
  1611.           XELSE 
  1612.                b5%=2
  1613.           END IF
  1614.           BUTTON 5 ,b5%
  1615.      END IF
  1616.      LONG IF Act%=6 OR Act%=7
  1617.           Field%=Field%+1
  1618.           IF Field%>6 THEN Field%=1
  1619.           EDIT FIELD #Field%
  1620.      END IF
  1621.      LONG IF Act%=2
  1622.           EDIT FIELD #Ref%
  1623.           Field%=Ref%
  1624.      END IF
  1625.      IF Act%=5 THEN "Format Window"
  1626.  
  1627.      RETURN
  1628.  
  1629.  
  1630. "Frame Button"
  1631.  
  1632.      CALL INSETRECT(T%,-4,-4):                ' Expand T,L,B,R
  1633.      PEN 3,3,1,8,0:                           ' Reset pensize
  1634.      CALL FRAMEROUNDRECT(T%,16,16):           ' Now frame it
  1635.      CALL INSETRECT(T%,4,4):CALL PENNORMAL:   ' Restore T,L,B,R
  1636.      RETURN
  1637.  
  1638.  
  1639. "Build Window"
  1640.  
  1641.      IF WND=1 THEN WINDOW 1,"Configure Menu",(27,58)-(477,273),17
  1642.      GOSUB "Build Edits" 
  1643.      RETURN
  1644.  
  1645.  
  1646. "Format Window"
  1647.  
  1648.      CALL PENNORMAL
  1649.  
  1650.      LONG IF WINDOW(0)=1
  1651.           T=9:L=105:B=33:R=443:PEN 1,1,1,8
  1652.           CALL FRAMERECT(T)
  1653.           T=43:B=67
  1654.           CALL FRAMERECT(T)
  1655.           T=155:L=375:B=175:R=434:GOSUB"Frame Button"
  1656.           T=78:L=105:B=102:R=420
  1657.           CALL FRAMERECT(T)
  1658.           TEXT 0,12,0,0:T=151:L=8:B=167:R=99:TEMP$="NetMail Area:"
  1659.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T, 0)
  1660.           T=146:L=105:B=170:R=194
  1661.           CALL FRAMERECT(T)
  1662.           T=180:B=204
  1663.           CALL FRAMERECT(T)
  1664.           T=185:L=20:B=201:R=99:TEMP$="Last Msg #:"
  1665.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T, 0)
  1666.           T=83:B=99:TEMP$="Import Log:"
  1667.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T, 0)
  1668.           T=13:L=29:B=29:TEMP$="BBS Name:"
  1669.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T, 0)
  1670.           T=48:L=25:B=64:TEMP$="BBS Folder:"
  1671.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T, 0)
  1672.           T=112:L=105:B=136:R=420
  1673.           CALL FRAMERECT(T)
  1674.           T=116:L=3:B=132:R=99:TEMP$="AreaFix Name:"
  1675.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T, 0)
  1676.           T=184:L=220:B=200:R=349:TEMP$="Import Engine 2.55"
  1677.           CALL TEXTBOX(VARPTR(TEMP$)+1,LEN(TEMP$),T, 0)
  1678.     END IF
  1679.     TEXT 0,12,0,0 
  1680.     CALL PENNORMAL
  1681.     RETURN
  1682.  
  1683.  
  1684. "Build Edits"
  1685.  
  1686.     TEXT ,,0,0
  1687.  
  1688.     LONG IF WINDOW(0)=1
  1689.          TEXT 0,12,
  1690.          EDIT FIELD 1,RRHost$,(108,13)-(440,28),3,1
  1691.          EDIT FIELD 2,BBSFolder$,(108,47)-(440,62),3,1
  1692.          BUTTON 1 ,1," Save ",(375,155)-(434,175),1
  1693.          BUTTON 2 ,1,"Cancel",(375,185)-(438,205),1
  1694.          EDIT FIELD 3,ImExportLog$,(108,82)-(417,97),3,1
  1695.          EDIT FIELD 4,AreaFix$,(108,116)-(417,131),3,1
  1696.          EDIT FIELD 5,NetMailArea$,(108,150)-(191,165),3,1
  1697.          EDIT FIELD 6,OldHighMessage$,(108,184)-(191,199),3,1
  1698.          BUTTON 3 ,b3%,"Use Full Reports",(224,152)-(349,167),2
  1699.          BUTTON 4 ,b4%," ",(424,82)-(448,97),2:' Activate ImportLog
  1700.          BUTTON 5 ,b5%," ",(424,117)-(448,132),2:' Activate AreaFix
  1701.          EDIT FIELD 1
  1702.      END IF
  1703.      RETURN
  1704.  
  1705.  
  1706. "Resource Update"
  1707.  
  1708.      GOSUB "Cursor_Spin"
  1709.      Rs$=EDIT$(2)
  1710.      Check$=RIGHT$(Rs$,1)
  1711.      LONG IF Check$ <> ":"
  1712.           BBSFolder$=Rs$+":"
  1713.           BEEP
  1714.           Button%=0
  1715.           EDIT FIELD #2,BBSFolder$
  1716.           CURSOR 0
  1717.           GOTO "Loop"
  1718.      END IF
  1719.  
  1720.      RCount%=0
  1721.      FOR ResourceCount%=1220 TO 1225
  1722.                
  1723.           GOSUB "Cursor_Spin"
  1724.           RCount%=RCount%+1
  1725.           default$ = EDIT$(RCount%)
  1726.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1727.           CALL SETSTRING(StrHnd&,default$)
  1728.           CALL CHANGEDRESOURCE(StrHnd&)
  1729.           CALL UPDATERESFILE(Refnum%)
  1730.  
  1731.       NEXT ResourceCount%
  1732.  
  1733.           GOSUB "Cursor_Spin"
  1734.           default$ = STR$(b3%):ResourceCount%=1226
  1735.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1736.           CALL SETSTRING(StrHnd&,default$)
  1737.           CALL CHANGEDRESOURCE(StrHnd&)
  1738.           CALL UPDATERESFILE(Refnum%)
  1739.  
  1740.           default$ = STR$(b4%):ResourceCount%=1227
  1741.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1742.           CALL SETSTRING(StrHnd&,default$)
  1743.           CALL CHANGEDRESOURCE(StrHnd&)
  1744.           CALL UPDATERESFILE(Refnum%)
  1745.       
  1746.           default$ = STR$(b5%):ResourceCount%=1228
  1747.           StrHnd&=FN GETRESOURCE(CVI("STR "),ResourceCount%)
  1748.           CALL SETSTRING(StrHnd&,default$)
  1749.           CALL CHANGEDRESOURCE(StrHnd&)
  1750.           CALL UPDATERESFILE(Refnum%)
  1751.  
  1752.       CURSOR 0
  1753.  
  1754.       RETURN
  1755.       
  1756.       
  1757. "AreaFix_Launch_Error"
  1758.      ErrLine$="<<Error"+STR$(ERROR)+">> *"+AreaFix$+"* AreaFix Application Not Found "
  1759.      GOSUB "Error Log"
  1760.      GOSUB "PrepareNextLaunch"
  1761.      END
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770. Shareware price for mantissa is $30.00.  
  1771.  
  1772.      The following is a list of features in Mantissa 3.2.
  1773.  
  1774.      Mantissa is a message base management utility, that helps SS/Tabby
  1775.      sysops maintain the high volume of echo and local mail that enter
  1776.      and leave their system.
  1777.  
  1778.      o Each message section can have a unique:
  1779.           o Day limit (0-999)
  1780.           o Section Limit (0-999)
  1781.           o Archive Limit (0-999k)*
  1782.           o Archive Location (any valid path)*
  1783.      o Archives can have unique or the same archive paths*
  1784.      o nonSection messages are automatically deleted*
  1785.      o Global Limit Set Option*
  1786.      o Global Day Limit Set Option*
  1787.      o Global Archive Limit Set Option*
  1788.      o Global Archive Location Set Option*
  1789.      o Control 'set' Buttons for Setting unique Pathnames*
  1790.      o Multiple ways to move from section to section*
  1791.           o List Manager Scroll Feature*
  1792.           o Popup Menus*
  1793.           o Control Button Forward/Reverse*
  1794.           o Menu Commands*
  1795.           o Command Keys*
  1796.      o On Line Help*
  1797.      o Full Support of Mac Interface
  1798.      o Delete by Age Only
  1799.      o Delete by Limit Only
  1800.      o Delete by both Age/Limit
  1801.      o Master Archive On/Off switch*
  1802.      o Individual Delete/Limit ON/OFF Markers*
  1803.      o Renumber Messages*
  1804.           o Renumber Forward from message #1*
  1805.           o Renumber Reverse from high Message No.*
  1806.           o Renumber Userlog, High message last read*
  1807.           o Renumber on Specified Dates Only*
  1808.      o Use STR's or Text file to save settings.*
  1809.      o Network and Remote Maintenance supported
  1810.      o Turn Mantissa Log On/Off
  1811.      o Select Location and Name of Mantissa Log
  1812.      o Epistle Generator
  1813.           o On/Off Epistle Generator
  1814.           o Max. Message Level Show Clearance
  1815.           o Select location/name of Epistle Report
  1816.           o Append/Erase Epistle Report
  1817.      o Keep .Bak's or discard them*
  1818.      o Security marker for High Clearance sections*
  1819.      o Major speed boost over 1.0
  1820.      o Tabby Compatible or Standalone        * - New in 3.x version
  1821.  
  1822.  
  1823. In addition to Mantissa 3.2 Registered users are provided with the 
  1824. updated Export 3.2.  Export is a utility that is essential if you run 
  1825. SS and Tabby.  Export 3.2 has been greatly expanded and turbo charged.
  1826. Sysop are are given extraordinary control over data exported from their 
  1827. system.  Export 3.2, Probe 3.2, PreStamp 3.2 and Sundial 3.2 are only 
  1828. being made available to Registered Mantissa users.
  1829.  
  1830. Options Available in Export 3.2:
  1831.  
  1832.      o Point Message Support*     
  1833.      o Process all/new Messages*
  1834.      o Delete NetMail as Processed
  1835.      o Notify Sysop of Export*
  1836.      o Summary of Last 5 Exports*
  1837.      o Append Origin to Netmail
  1838.      o D'Bridge Areafix support
  1839.      o Turn Log on/off
  1840.      o Select location/name of log
  1841.      o Append directly to Tabby Log
  1842.      o Full support of mac interface
  1843.      o Use Short/Long Reports
  1844.      o Node Alias for Netmail*
  1845.      o Use Generic Echoes/Seenby.bbs files*
  1846.      o Compatible with Origin Master (by Lance Rasmussen)
  1847.      o On Line Help*
  1848.      o Major speed boost over 2.52
  1849.      o Erase/Append to Log*       * - New in 3.x version
  1850.  
  1851.  
  1852. Utilities from, Lininger Technology:
  1853.  
  1854.                    Free to all         Registered Mantissa
  1855. Versions
  1856.  
  1857. Export                2.54                  3.2
  1858. Import                2.53                  2.53 (update soon)
  1859. Sundial               2.1                   3.2
  1860. PreStamp              2.0                   3.2
  1861. Mantissa              1.0 (demo)            3.2
  1862. Probe                  .53                  3.2
  1863. R.Prestamp            2.0                   2.0  (update soon)
  1864. Sapphire              2.1t                  2.1t (update soon)
  1865. Epistle II            1.0                   1.0   
  1866. TPort                 1.0                   1.0
  1867. *Pleiades (1)         -NA-                   .25 (Phase 1 only)
  1868.  
  1869.  
  1870. Special thanks to,
  1871.     Tom Fitzsimmons, Mark Bryant, Lance Rasmussen & Ralph Merritt
  1872. for their great ideas and for risking life and data while beta testing
  1873. the above products.
  1874.  
  1875.  
  1876. Mantissa($30.00):
  1877. Lininger Technology
  1878. Suite 'A'
  1879. 385 Bowling Green Place
  1880. Gahanna, Ohio  43230
  1881. 614-471-6209  226/200
  1882.  
  1883.  
  1884.  
  1885. Applications Freq. from 1:226/200 or 1:350/90
  1886.  
  1887. For General Release:
  1888.  
  1889. Epistle1.sit - Epistle II 1.0
  1890. Export25.sit - Export 2.54
  1891. Import25.sit - Import 2.53
  1892. Mant10.sit   - Mantissa 1.0
  1893. PreStp20.sit - Prestamp 2.0
  1894. Probe.53.sit - Probe .53
  1895. RPreSt20.sit - R.Prestamp (Robot)
  1896. Sapph21t.sit - Sapphire 2.1t
  1897. Sundil21.sit - Sundial 2.1
  1898. TPort10.sit  - TabbyPort 1.0
  1899. TurboT.sit   - TurboPascal launch.next source (original by Pete Johnson)
  1900. ZLaunch.sit  - ZBasic launch.next source code
  1901.  
  1902.                No password required to get the above files
  1903.  
  1904.  
  1905.  
  1906. For Restistered Mantissa Users:
  1907.  
  1908. Export32.sit <password> - Export 3.21
  1909. Mant32.sit   <password> - Mantissa 3.2
  1910. PreStp32.sit <password> - PreStamp 3.2
  1911. Probe32.sit  <password> - Proble 3.2
  1912. Sundil32.sit <Password> - Sundial 3.2
  1913.  
  1914.              <Password> is the first 4 uppercase characters of the filename
  1915.                         mentioned in your Mantissa registration cover letter 
  1916.                         that accompanied your master disk.
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.